package com.exercise.DesignPattern.BehavioralPatterns.MediatorPattern;

//具体组件B
public class ComponentB extends Component{

    public ComponentB(Mediator mediator) {
        super(mediator);
    }

    @Override
    public void handleEvent(String event) {
        System.out.println("ComponentB handling event: "
                + event);
    }

    public void triggerEvent(String event) {
        mediator.notify(this, event);
    }
}
